import Vue from 'vue'
import Router from 'vue-router'
const login = r => require.ensure([], () => r(require('@/pages/login')), 'login');
const manage = r => require.ensure([], () => r(require('@/pages/manage')), 'manage');
const userList = r => require.ensure([], () => r(require('@/pages/main/userList')), 'userList');

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/manage',
      name: 'manage',
      component: manage,
      children: [
        {
          path: 'userList',
          component: userList
        }
      ]
    }
  ]
})
